Skip to main content

Getting Started

Creating a New Widget

You can scaffold a web widget in two ways:

ApproachCommandBest for
Offline starternx generate @cdx-extensions/widget-template-web:widget <widget-name>Blank Module Federation remote with no catalog
Catalog templatesnx run generate-web-widgetDI-backed starters from the extension template catalog

Both create a new app under widgets/web/ with the required Module Federation configuration. Only modify files inside src/app/ for your widget logic and UI.

For catalog-driven generation (category picker and npm template overlays), see Extension Template Catalog. Quick reference:

Bash
nx run generate-web-extensions          # interactive: type → category → template → name
nx run generate-web-widget # interactive: widget only
nx run generate-web-widget -- --template=agent --name=test-widget
File / FolderCan you edit?Notes
src/app/YesAll your widget UI and business logic goes here
src/environments/YesSet apiUrl and feature flags per environment
src/assets/YesAdd images, fonts, static files
module-federation.config.tsPartiallyOnly change name and exposes
project.jsonPartiallyOnly change port under serve / serve-static
webpack.config.tsNoRequired for Module Federation — any change breaks loading in OLB
bootstrap.tsx / main.tsNoRequired async boundary for Module Federation
tsconfig*.json / jest.config.tsNoRequired for build and test tooling

Next Steps

Web development guides: